import { http } from '@/utils/http/axios';

export interface GameModel {
  agentId: string;
  cardAuth: string;
  createTime: string;
  gameDesc: string;
  gameId: string;
  gameName: string;
  gameUrl: string;
  iconUrls: string;
  id: number;
  loadImgUrl: string;
  onlineTime: string;
  payCallbackUrl: string;
  previewUrls: string;
  proportion: number;
  status: string;
  updateTime: string;
}

/**
 * 获取全部通道
 */
export function getGameAll() {
  return http.request({
    url: '/system/game/all',
    method: 'GET',
  });
}

/**
 * 更新游戏
 * @param params
 */
export function updateGame(params: GameModel) {
  return http.request({
    url: '/system/game/update',
    method: 'POST',
    params,
  });
}

/**
 * 添加游戏
 * @param params
 */
export function registerGame(params: GameModel) {
  return http.request({
    url: 'system/game/regist',
    method: 'POST',
    params,
  });
}

/**
 * 获取所有区服
 * @param params
 */
export function getAllArea() {
  return http.request({
    url: '/system/game/allArea',
    method: 'POST',
  });
}
